<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/page/inc/taglib.jsp"%>
<div class="pageHeader">
	<form id="pagerForm" onsubmit="return navTabSearch(this);" action="${pageContext.request.contextPath}/system/department/list" method="post">
		<!-- 分页表单参数 -->
		<%@include file="/WEB-INF/page/inc/pageForm.jsp"%>
		<!-- 需要排序的字段 -->
		<input type="hidden" name="orderField" value="${requestScope.dwzPageBean.countResultMap.orderField}" />
		<!-- 正序倒序 -->
		<input type="hidden" name="orderDirection" value="${requestScope.dwzPageBean.countResultMap.orderDirection}" />
		<div class="searchBar">
			<table class="searchContent">
				<tr>
					<%-- <td>部门名称：<input type="text" name="name" value="${requestScope.dwzPageBean.countResultMap.name}" size="30" placeholder="请输入部门名称" /></td> --%>
					<td>部门名称：<input size="30" placeholder="请输入部门名称" name="org2.name" type="text" postField="name" suggestFields="name" suggestUrl="${pageContext.request.contextPath}/system/department/getDepartmentName" lookupGroup="org2" value="${requestScope.dwzPageBean.countResultMap.name}" /></td>
				</tr>
			</table>
			<div class="subBar">
				<ul>
					<li>
						<div class="buttonActive">
							<div class="buttonContent">
								<button type="submit">查询</button>
							</div>
						</div>
					</li>
				</ul>
			</div>
		</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<shiro:hasPermission name="/system/department/Departmentexport">
				<li><a href="${pageContext.request.contextPath}/system/department/Departmentexport" target="dwzExport" targetType="navTab" title="是要导出这些记录吗?" class="icon"><span>导出EXCEL</span></a></li>
			</shiro:hasPermission>
			<shiro:hasPermission name="/system/department/toInsert">
				<li><a class="add" href="${pageContext.request.contextPath}/system/department/toInsert" rel="insert" target="dialog" width="820" height="460" mask="true"><span>添加</span></a></li>
			</shiro:hasPermission>
			<shiro:hasPermission name="/system/department/delete">
				<li><a class="delete" href="${pageContext.request.contextPath}/system/department/delete" rel="id" target="selectedTodo" title="确定要删除吗？" warn="请最小选择一条记录" mask="true"><span>批量删除</span></a></li>
			</shiro:hasPermission>
		</ul>
	</div>
	<table class="table" targetType="navTab" asc="asc" desc="desc" width="100%" layoutH="138">
		<thead>
			<tr>
				<th width="22"><input type="checkbox" group="id" class="checkboxCtrl"></th>
				<th orderField="name" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'name'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>部门名称</th>
				<th orderField="arst" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'arst'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>编制</th>
				<th orderField="cunt" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'cunt'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>在职人数</th>
				<th orderField="remk" width="150" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'remk'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>备注</th>
				<th width="190">操作</th>
			</tr>
		</thead>
		<tbody>
			<c:if test="${requestScope.dwzPageBean != null &&  requestScope.dwzPageBean.recordList != null }">
				<c:forEach var="record" items="${requestScope.dwzPageBean.recordList}" varStatus="status">
					<tr ondblclick="openDetails(this)" target="dialog" href="${pageContext.request.contextPath}/system/department/details?dmid=${record.id}" title="详情">
						<td><c:if test="${record.del!=3}">
								<input name="id" value=${record.id } type="checkbox">
							</c:if></td>
						<td>${record.name}</td>
						<td>${record.arst}</td>
						<td>${record.cunt}</td>
						<td>${record.remk}</td>
						<td><shiro:hasPermission name="/system/department/details">
								<a target="dialog" href="${pageContext.request.contextPath}/system/department/details?dmid=${record.id}" class="detailsBtn" mask="true" width="820" height="460"><span>详情</span></a>
							</shiro:hasPermission> <shiro:hasPermission name="/system/department/toUpdate">
								<a title="编辑" target="dialog" mask="true" href="${pageContext.request.contextPath}/system/department/toUpdate?id=${record.id}" class="editBtn"><span>编辑</span></a>
							</shiro:hasPermission> <c:if test="${record.del!=3}">
								<shiro:hasPermission name="/system/department/delete">
									<a title="确定要删除吗？" mask="true" target="ajaxTodo" href="${pageContext.request.contextPath}/system/department/delete?id=${record.id}" class="deleteBtn"><span>删除</span></a>
								</shiro:hasPermission>
							</c:if></td>
					</tr>
				</c:forEach>
			</c:if>
		</tbody>
	</table>
	<!-- 分页条 -->
	<%@include file="/WEB-INF/page/inc/pageBar.jsp"%>
</div>